package com.huak.boot.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * {@link AfterHelloApplicationListener} {@link ApplicationListener} 监听{@link ContextRefreshedEvent}
 * @author LR2SD
 * @description
 * @date 2019-03-30 09:43
 */
public class AfterHelloApplicationListener implements ApplicationListener<ContextRefreshedEvent>,Ordered{

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("after HelloApplicationListener event.id="+event.getSource()+" timestamp="+event.getTimestamp());
    }

    @Override
    public int getOrder() {
        return Ordered.LOWEST_PRECEDENCE;
    }
}
